﻿using Max.PH4_2102A.Shopping.DAL;
using Max.PH4_2102A.Shopping.Domain;
using Max.PH4_2102A.Shopping.IRespository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Max.PH4_2102A.Shopping.Respository
{
    public class SKUImageRespository : ISKUImageRespository
    {
        EFCoreHelper _db;
        /// <summary>
        /// 构造注入
        /// </summary>
        /// <param name="db"></param>
        public SKUImageRespository(EFCoreHelper db)
        {
            _db = db;
        }
        public IQueryable<SKUImageModel> GetAll()
        {
            return _db.SKUImages;
        }

        public void Insert(SKUImageModel model)
        {
             _db.SKUImages.Add(model);
        }

        public void Insert(List<SKUImageModel> model)
        {
            _db.SKUImages.AddRange(model);
        }

        public void Update(SKUImageModel model)
        {
            _db.SKUImages.Update(model);
        }
    }
}
